****************************************************************************
*** From Thin to Thick Representation: How a Female President Shapes Female Parliamentary Behavior
*** American Political Science Review
*** Michael Wahman, Nikolaos Frantzeskakis, and Tevfik Murat Yildirim
*** Replication Files
*** Date: January 23, 2021
****************************************************************************

* set cd
cd ""

run "scheme.do"



**** Table 2: Descriptive Statistics (for the third parliamentary session in the dataset)
use "MalawiDiscourses_replication.dta", clear

* dependent variables
sum MPspeechCount if ParSession == 3
sum economy if ParSession == 3

* independent variables
sum banda if ParSession == 3
sum female if ParSession == 3
sum senior if ParSession == 3
sum Newcomer if ParSession == 3
sum finance_com if ParSession == 3
sum DPP if ParSession == 3
sum PP if ParSession == 3
sum MCP if ParSession == 3
sum indep if ParSession == 3
sum month0 if ParSession == 3


**** Figure 1: Female parliamentary representation and political empowerment

* To create the following graph we use 2 V-dem indicators, v2x_gender and v2lgfemleg for the year 2012 if v2x_regime > 1.
* Coppedge, Michael, John Gerring, Carl Henrik Knutsen, Staffan I. Lindberg, Jan Teorell, David Altman, Michael Bernhard, M. Steven Fish, Adam Glynn, Allen Hicken, Anna Luhrmann, Kyle L. Marquardt, Kelly McMann, Pamela Paxton, Daniel Pemstein, Brigitte Seim, Rachel Sigman, Svend-Erik Skaaning, Jeffrey Staton, Steven Wilson, Agnes Cornell, Nazifa Alizada, Lisa Gastaldi, Haakon Gjerløw, Garry Hindle, Nina Ilchenko, Laura Maxwell, Valeriya Mechkova, Juraj Medzihorsky, Johannes von Römer, Aksel Sundström, Eitan Tzelgov, Yi-ting Wang, Tore Wig, and Daniel Ziblatt. 2020. ”V-Dem [Country–Year/Country–Date] Dataset v10”. Varieties of Democracy (V-Dem) Project. https://doi.org/10.23696/vdemds20.


use "V-Dem_graph.dta", clear
mean(v2x_gender)
mean(v2x_gender) if e_regionpol == 4
mean(v2lgfemleg)
mean(v2lgfemleg) if e_regionpol == 4

gen malawi = country_name if country_name == "Malawi"



twoway (scatter v2x_gender v2lgfemleg, mlabel(malawi)) (scatter v2x_gender v2lgfemleg if malawi == "Malawi", mcolor(black)), yline(.807, lpattern(dash)) yline(.85) xline(19.58, lpattern(dash)) xline (21.64)  legend(off)




**** Figure 2: Female to male MP speech ratio from Mutharika to Banda
use "MalawiDiscourses_replication.dta", clear

keep if ParSession == 3
keep if Newcomer == 1
keep if senior == 0
keep if indep == 0

collapse  (mean) MPspeechCount, by (month banda female)


sort month banda female
gen speech_women_to_men = 1
replace speech_women_to_men = MPspeechCount / MPspeechCount[_n-1] if female == 1

gen monthGraph = month - 38


twoway (lpolyci speech_women_to_men monthGraph if banda ==0  & female ==1) (lpolyci speech_women_to_men monthGraph if banda ==1 & female ==1 ), graphregion(color(white)) bgcolor(white) ytitle("Female/Male MP Speech Ratio") xtitle("Month") legend(pos(6) fcolor(white) label (2 "Mutharika") label (3 "Banda"))



**** Figure 3: Barplot of participation for DPP and MCP
use "MalawiDiscourses_replication.dta", clear

keep if ParSession == 3
keep if MCP == 1 | DPP == 1
keep if Newcomer == 1
keep if senior == 0
keep if indep == 0

label define partyID 0 "DPP" 1 "MCP" 
label values MCP partyID

ttest MPspeechCount if DPP == 1 & female == 1, by(banda)
ttest MPspeechCount if MCP == 1 & female == 1, by(banda)

collapse  (mean) MPspeechCount, by (banda MCP female)
gen speech_women_to_men = 1
replace speech_women_to_men = MPspeechCount / MPspeechCount[_n-1] if female == 1 
drop if female == 0

graph bar (asis) speech_women_to_men, over(banda) over(MCP) ytitle("Female/Male MP Speech Ratio")







**** Figure A1: Speech Topics for Male and Female MPs
use "MalawiDiscourses_replication.dta", clear

keep if ParSession == 3

graph set window fontface MinionPro-Subh


collapse (first) Session (mean) MPspeechCount wordCount Topic1-Topic20, by (female)

* Female to male speech %
gen sp_ratio = MPspeechCount / MPspeechCount[_n-1]


reshape long Topic, i(female) j(topicId) 

keep if topicId == 20 | topicId == 1 | topicId == 4 | topicId == 12 | topicId == 10 | topicId == 3 | topicId == 14 
keep if female ~= .

replace topicId = 100 if topicId == 20
replace topicId = 101 if topicId == 1
replace topicId = 102 if topicId == 12
replace topicId = 103 if topicId == 4
replace topicId = 104 if topicId == 10
replace topicId = 105 if topicId == 14
replace topicId = 106 if topicId == 3


label define topicId 100 "Government" 101 "Macroeconomics" 102 "Agriculture" 103  "Transportation" 104 "Crime" ///
105 "Health" 106 "Housing"
label values topicId topicId


graph hbar Topic, over(female) over(topicId) asyvars graphregion(color(white)) bgcolor(white) bargap(25) ytitle("")  title("") note("Note: Average number of speeches/month by topic category for the average male and female MP.")


